package com.zysd.collection.scheduler.system.job;

import com.zysd.collection.scheduler.service.channel.OfflineScaleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 描述
 *
 * @author liuht
 * @date 2017/10/23 10:00
 */
@Component
public class SchedulerJobAutoConfiguration {


    private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private OfflineScaleService offlineScaleService;

    //@Scheduled(cron = "0/120 * * * * ?")
    public void collectDay() throws ParseException {
        offlineScaleService.scale(dateFormat.format(new Date()));
    }

}
